package is.common.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

/**
 * Holds static compressing and uncompressing operations.
 *
 * @author aspr0
 */
public class Compressor
{
    /**
     * @param os
     * @return zipped output stream
     */
    public static OutputStream compress(OutputStream os) throws IOException
    {
        return new GZIPOutputStream(os);
    }

    /**
     * @param is zipped input stream
     * @return unzipped input stream
     */
    public static InputStream uncompress(InputStream is) throws IOException
    {
        return new GZIPInputStream(is);
    }
}
